#pragma once

#include <opencv2/opencv.hpp>
#include <string>

struct Detection
{
    int class_id{ 0 };
    std::string className{};
    float confidence{ 0.0 };
    cv::Scalar color{};
    cv::Rect box{};
};

enum task_type { 
    infer_cls=0,    // 分类
    infer_detect,   // 目标检测
    infer_segment,  // 语义分割
    infer_trace,    // 目标跟踪
    infer_obb,      // 旋转目标检测：Oriented Bounding Boxes Object Detection
    infer_pos};     // 姿态检测：人体姿态

using DetectionResults = std::vector<Detection>;    // 检测结果队列
using ProcessInfoList = std::vector<std::string>;   // 存放字符串队列

class IInfer
{
public:
	virtual ~IInfer() {};

    // 设定当前推理类型：分类、目标检测......
    virtual void setTaskType(task_type taskType) = 0;
    // 运行单帧推理
    virtual DetectionResults runInfer(cv::Mat& src) = 0;
    // 加载模型文件
    virtual bool loadModel(std::string modelPath) = 0;
    // 加载标签文件：分类标签
    virtual bool loadLabels(std::string labelFilePath) = 0;
    // 设置原图像
    virtual void setSrcImage(cv::Mat& src) = 0;
    // 设置标准推理参数
    virtual void setInferParams(float modelConfidence=0.25, float modelScore=0.25, float modelNMS=0.45) = 0;
    // 返回推理过程中信息
    virtual std::string getInferInfo() = 0;
};